/**
 * Sample React Native App
 * https://github.com/facebook/react-native
 * @flow
 */

import React, {Component} from 'react';
import {
    AppRegistry,
    StyleSheet,
    View,
    Image,
    Navigator,
} from 'react-native';

import First from './js/First';

export default class AwesomeProject extends Component {
    render() {
        let defaultName = 'First';
        let defaultComponent = First;
        return (
            <Navigator
                //指定了默认的页面，也就是启动app之后会看到的第一屏，需要两个参数，name跟component
                initialRoute={{ name: defaultName, component: defaultComponent,title:'Call酒么',index:0}}
                configureScene={(route) => {
                //跳转的动画
                return Navigator.SceneConfigs.FadeAndroid;
          }}
                renderScene={(route, navigator) => {
                let Component = route.component;
                if(route.component){
                    return <Component  navigator={navigator} />
                }
            }
            }
            />
        );
    }
}

AppRegistry.registerComponent('AwesomeProject', () => AwesomeProject);
